#include <stdio.h>
#include <string.h>

#define LEN 100

void reverseString(char s1[],int n)
{
    char *reverse = s1;
    char *end = s1 + n - 1;
    char temp;
  
    while (reverse < end)
    {
        temp = *reverse;
        *reverse = *end;
        *end = temp;

        reverse++;
        end--;
    }
}


int main()
{
    char a[LEN];
 
    printf("请输入字符：\n");
    scanf("%s",a);
    while(getchar() != '\n');
    
    int len = strlen(a);

    printf("字符为： %s\n",a);

    reverseString(a,len);

    printf("逆序后为： %s\n",a);

    return 0;
}